CygNet Studio is an object-driven environment. The controls that you place on a studio screen are treated as objects when scripting, and therefore include a set of properties, methods, and events relevant to the object type.
The screen itself is also an object, called TheView. On a new screen, this is the only object in the script editor’s Object drop-down menu. In particular, TheView contains an event called EventInitialize. This event fires once each time the screen runs, so it is a useful location for initialization logic.
The properties of an object are displayed in a drop-down menu when the object’s name is typed followed by a period. Properties can also be viewed in the Property Window.
The FormCode property is unique to TheFrame/TheView. It is its unique identifier. It is always shown in parentheses on the Property Sheet.
The ObjectCode property applies to each object added to TheView. It is the unique identifier of the object. The default ObjectCode represents the tool type and the instance of the tool (for example, TextTool1). The ID can be changed. Valid characters are A-Z, 0-9, and underscore (_). The ID cannot contain spaces and can be a maximum of 39 characters.
The properties that represent CygNet items are listed on the Property Sheet in square brackets. These properties define what point the item is tied to, what it displays, how it displays alarm information, etc.
The unbracketed properties are general formatting properties, such as the font, text alignment, rotation, foreground color, background color, etc.
Each object placed on a screen has built-in events. To view these events, double-click an object. The script editor is displayed with the object’s events listed in the Event drop-down menu. For example, a button control placed on the screen will include an EventClick event that is run when the user clicks the button. Of course, the event contains no code when a button is created.
The methods of an object are displayed in a drop-down menu when the object’s name is typed followed by a period. Properties can also be viewed in the Property Window.
More: